/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.strategy.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.strategy.dto.StrategyStopOrderContractAddBatchDTO;
import com.pig4cloud.pigx.strategy.dto.StrategyStopOrderContractAddDTO;
import com.pig4cloud.pigx.strategy.dto.StrategyStopOrderContractCancelBatchDTO;
import com.pig4cloud.pigx.strategy.dto.StrategyStopOrderContractConditionDTO;
import com.pig4cloud.pigx.strategy.entity.StrategyStopOrderContract;

import java.util.List;

/**
 * 策略止盈止损-合约
 *
 * @since 2022-11-24 10:39:26
 */
public interface StrategyStopOrderContractService extends IService<StrategyStopOrderContract> {

    /**
     * 分页查询
     *
     * @param page      分页条件
     * @param condition 查询条件
     * @return {@link Page< StrategyStopOrderContract>}
     * @since 2023/2/13 09:49
     */
    Page<StrategyStopOrderContract> page(Page<StrategyStopOrderContract> page, StrategyStopOrderContractConditionDTO condition);

    /**
     * 新增
     *
     * @param dto dto
     * @since 2023/2/8 15:17
     */
    void add(StrategyStopOrderContractAddDTO dto);

    /**
     * 批量新增
     *
     * @param dto dto
     * @since 2023/2/12 19:16
     */
    void addBatch(StrategyStopOrderContractAddBatchDTO dto);

    /**
     * 批量撤销
     *
     * @param dto dto
     * @since 2023/2/10 15:34
     */
    void cancelBatch(StrategyStopOrderContractCancelBatchDTO dto);

    /**
     * 撤销任务的所有止盈止损
     *
     * @param taskId 任务id
     * @since 2023/2/12 17:06
     */
    void cancelByTask(Long taskId);

    /**
     * 批量撤销任务的所有止盈止损
     *
     * @param taskIdList 任务idList
     * @since 2023/2/12 17:06
     */
    void cancelByTaskBatch(List<Long> taskIdList);

    /**
     * 一键撤销
     *
     * @param strategyId 策略id
     * @since 2023/2/12 17:17
     */
    void cancelAll(Long strategyId);
}
